#define _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    vector<string> buildArray(vector<int>& target, int n)
    {
        vector<string> ret;
        if (target.size() == 1 && target[0] == 1) return { "Push" };
        int i = 1;
        vector<bool> check(n);
        for (int i = 0; i < target.size(); i++)
        {
            check[target[i]] = true;
        }
        while (i != target[target.size() - 1] + 1)
        {
            if (check[i]) ret.push_back("Push");
            else
            {
                ret.push_back("Push");
                ret.push_back("Pop");
            }
            i++;
        }
        return ret;
    }
};